home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1990 April / 1990-04.d64 / think tank (.txt) < prev   
Commodore BASIC  |  2022-09-20  |  5KB  |  127 lines

  1. 10 rem copyright 1990 compute! publications, inc. - all rights reserved
  2. 15 poke53280,15:poke53281,15
  3. 20 print"[147][144]            copyright 1990":print"       compute! publications, inc."
  4. 30 print"          all rights reserved"
  5. 40 fora=16000to16383:readn:pokea,n:next:fora=15936to15999:pokea,0:next
  6. 50 input " player 1's name";p1$:if p1$=""then50
  7. 60 input " player 2's name";p2$:if p2$=""then60
  8. 70 a$="         "
  9. 80 p1$=left$(p1$,9):iflen(p1$)<9thenp1$=p1$+left$(a$,9-len(p1$))
  10. 90 p2$=left$(p2$,9):iflen(p2$)<9thenp2$=p2$+left$(a$,9-len(p2$))
  11. 100 h(1)=27:h(2)=27:h(3)=43:h(4)=59:h(5)=59:h(6)=43:w0=0:v=53248:s=54272
  12. 110 v(1)=70:v(4)=54:v(3)=102:v(2)=198:v(5)=182:v(6)=150:in=4:mo=4:gosub590
  13. 120 forta=1to6:gosub650:next:pokev+21,126
  14. 130 pokes+16,250:pokes+17,7:pokes+24,8:pokes+14,40
  15. 140 forta=1to6:forl=1to10:m$(ta,l)="x":next:next:poke198,0:print:print""p1$;
  16. 150 print" --> [214] [214] [214] [214] [214] [214] [214] [214] [214] [214]":print"[158]"p2$" --> [214] [214] [214] [214] [214] [214] [214] [214] [214] [214]";
  17. 160 forxx=1to2:poke781,23+pl:poke782,14:poke783,peek(783)and254:sys65520
  18. 170 ifpl=0thenta=1:poke646,1
  19. 180 ifpl=1thenta=4:poke646,7
  20. 190 gosub790:ifxx=1thenpl=abs(pl-1)
  21. 200 next:l=1
  22. 210 ifpl=1thenforta=1to6
  23. 220 ifpl=0thenforta=6to1step-1
  24. 230 ifm$(ta,l)="x"then300
  25. 240 pp=peek(2040+ta):ifpp=250then300
  26. 250 pokes+14,180+ta*10:c=0:forn=1to5:ifm$(ta,l)=mid$("lrmf",n,1)thenc=n
  27. 260 next:br=0:ifta>3thenbr=40
  28. 270 poke1956+l*2+br,asc(m$(ta,l))-64:oncgosub320,340,360,380
  29. 280 ifpeek(2040+ta)<>250thenpoke2040+ta,pp
  30. 290 ifw0<>0thengoto100
  31. 300 next:l=l+1:ifl<11then210
  32. 310 print"[145][145][145]":goto130
  33. 320 pp=pp+1:ifpp=256thenpp=252
  34. 330 return
  35. 340 pp=pp-1:ifpp=251thenpp=255
  36. 350 return
  37. 360 pokes+24,15:forww=1tomo:onpp-251gosub480,520,540,570
  38. 370 gosub650:gosub900:next:pokes+24,8:return
  39. 380 vo=15:pokes+24,vo:pokes+4,128:pokes+4,129:k=150:pokes+11,16:pokes+11,17
  40. 390 tt=ta:h(0)=h(ta)+2:v(0)=v(ta)-6:ta=0:bo=0:in=16
  41. 400 in=16:n=(peek(v+16)and2^tt)/(2^tt):pokev+16,(peek(v+16)and254)orn
  42. 410 ifpp=255orpp=253thenpoke15988,0:poke15964,48:poke15967,48:goto430
  43. 420 poke15988,60:poke15964,0:poke15967,0:poke15970,0
  44. 430 pokev,h(0):pokev+1,v(0):pokev+21,peek(v+21)+1
  45. 440 k=k-1:onpp-251gosub480,520,540,570:gosub650:pokes+8,k:gosub660
  46. 450 ifbo=1andta=0andhi=0thenpokev+21,peek(v+21)-1:pokes+11,16
  47. 460 vo=vo-.5:pokes+24,vo:ifbo=0andhi=0then440
  48. 470 pokes+11,16:ta=tt:in=4:return
  49. 480 h(ta)=h(ta)-in:ifh(ta)<22and(peek(v+16)and2^ta)/(2^ta)=0thenh(ta)=27:bo=1
  50. 490 ifh(ta)<0thenh(ta)=255+h(ta):pokev+ta*2,h(ta):goto510
  51. 500 return
  52. 510 pokev+(16),(peek(v+16)and(255-(2^ta))):return
  53. 520 v(ta)=v(ta)+in:ifv(ta)>204thenv(ta)=198:bo=1
  54. 530 return
  55. 540 h(ta)=h(ta)+in:if(h(ta)>65and(peek(v+16)and2^ta)/(2^ta)=1)thenh(ta)=59:bo=1
  56. 550 ifh(ta)>255thenh(ta)=h(ta)-255:pokev+16,(peek(v+16)or(2^ta))
  57. 560 return
  58. 570 v(ta)=v(ta)-in:ifv(ta)<49thenv(ta)=54:bo=1
  59. 580 return
  60. 590 poke53281,14:print"[147][153]";:poke53280,14:forc=1to11:forn=1to20:print"[146][207][208]";:next
  61. 600 forn=1to20:print"[204][186]";:next:next:forn=0to63:poke15936+n,0:next:poke2041,253
  62. 610 poke2042,255:poke2044,253:poke2045,255:poke2043,254:poke2046,252
  63. 620 poke2040,249:pokev+16,112:pokev+37,2:pokev+38,0:pokev+28,255:forn=stos+24
  64. 630 poken,p:next:pokes+5,12:pokes+1,10:pokes+12,1:pokes+13,169
  65. 640 forn=1to3:pokev+39+n,1:next:forn=4to6:pokev+39+n,7:next:pokev+39,0
  66. 650 pokev+ta*2,h(ta):pokev+ta*2+1,v(ta):return
  67. 660 hi=0:forn=1to6:ifn=ttthen710
  68. 670 ifabs(h(0)-h(n))>8then710
  69. 680 ifabs(v(0)-v(n))>8then710
  70. 690 if(peek(v+16)and1)<>(peek(v+16)and2^n)/(2^n)then710
  71. 700 ifpeek(2040+n)<>250thenhi=1:sp=n
  72. 710 next:ifhi=0thenreturn
  73. 720 ifcl=0thenpokev+21,peek(v+21)-1
  74. 730 poke2040+sp,251:pokes+24,15:pokes+4,128:pokes+4,129:pokes+11,129
  75. 740 forwa=1to40:pokes+8,rnd(0)*100:next:pokes+24,8:pokes+11,128
  76. 750 pokev+21,peek(v+21)and(255-(2^sp)):poke2040+sp,250:gosub960:return
  77. 760 ta=ta+1:ifta>(3+pl*3)thenta=1+pl*3
  78. 770 ifpeek(2040+ta)=250thengoto760
  79. 780 pokes+14,40+ta*10:return
  80. 790 l=0
  81. 800 ifpeek(2040+ta)=250thengosub760:goto800
  82. 810 poke204,0:cc=peek(v+39+ta):pokes+20,240:pokes+18,65
  83. 820 pokev+39+ta,12:getm$:poke207,0:pokev+39+ta,cc:ifm$=""then820
  84. 830 ifasc(m$)=20andl>0thenpoke204,1:print"[146][214][157][157][157][214][157]";:m$(ta,l)="x":l=l-1:goto810
  85. 840 ifm$=" "thengosub760:goto810
  86. 850 c=0:forn=1to5:ifm$=mid$("lrmf",n,1)thenc=n+1
  87. 860 next:ifc=0thengoto810
  88. 870 br=0:ifta>3thenbr=40
  89. 880 l=l+1:poke204,1:print" ";:m$(ta,l)=m$:ifl<10then810
  90. 890 return
  91. 900 cl=0:forn=1to6:ifpeek(2040+n)=250then940
  92. 910 ifn=tathen940
  93. 920 b1=(peek(v+16)and(2^ta))/(2^ta):b2=(peek(v+16)and(2^n))/(2^n)
  94. 930 ifb1=b2thenifabs(h(ta)-h(n))<10andabs(v(ta)-v(n))<10thencl=1:sp=n:gosub730
  95. 940 next:ifcl=0thenreturn
  96. 950 sp=ta:gosub730:return
  97. 960 ifsp>3then990
  98. 970 w0=2:forn=1to3:ifpeek(2040+n)<>250thenw0=0
  99. 980 next:goto1010
  100. 990 w0=1:forn=4to6:ifpeek(2040+n)<>250thenw0=0
  101. 1000 next
  102. 1010 ifw0=0thenreturn
  103. 1020 pokes+24,0:pokev+21,0:poke53281,1
  104. 1030 print"[147][146]     congratulations tank commander"
  105. 1040 ifw0=1thenprintspc(5)p1$
  106. 1050 ifw0=2thenprintspc(5)p2$
  107. 1060 print"        press any key to continue":poke198,0
  108. 1070 getk$:ifk$=""then1070
  109. 1080 return:data0,0,0,16,0,0,0,0,0,0,0,16,0,66,0,136,0,0,40,8,0,3,32,32,32
  110. 1090 data204,128,0,202,0,2,32,0,2,0,0,72,136,0,10,206,0,8,0,128,32,48,0,0,48
  111. 1100 data0,0,12,0,4,0
  112. 1110 data4,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,4,0,0,0,2,32,8,2,128,10,73,0,2,43
  113. 1120 data0,2,220,128,6,178,0,2,123,0,2,236,0,10,138,0,10,14,0,8,3,128,33,0,0
  114. 1130 data0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  115. 1140 data0,0,0,0,59,184,0,255,255,2,167,214,2,159,250,255,255,250,2,159,250,2
  116. 1150 data167,214,0,255,255,0,187,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  117. 1160 data0,0,0,0,0,42,0,3,106,112,3,153,176,2,157,160,3,127,112,3,127,112,2
  118. 1170 data127,96,3,157
  119. 1180 data176,3,157,176,2,174,160,3,174,176,3,174,176,0,174,128,0,12,0,0,12,0,0
  120. 1190 data12,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,239
  121. 1200 data0,255,255,0,151,218,128,175,246,128,175,255,255,175,246,128,151,218
  122. 1210 data128,255,255,0,46,239,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,12,0,0
  123. 1220 data12,0,0,12,0,0,12,0,0
  124. 1230 data174,128,3,174,176,3,174,176,2,174,160,3,157,176,3,157,176,2,127,96,3
  125. 1240 data127,112,3,127,112,2,157,160,3,153,176,3,106,112,0,42
  126. 1250 data0,0,0,0,0,0,0,0,0,0,0
  127.